\subsection{Introduction}
A linear map (or linear transformation) is some operation \(T: V \to W\) between vector spaces \(V\) and \(W\) preserving the core vector space structure (specifically, the linearity).
It is defined such that
\[
	T\left(\lambda \vb x + \mu \vb y\right) = \lambda T(\vb x) + \mu T(\vb y)
\]
for all \(\vb x, \vb y \in V\) where the scalars \(\lambda\) and \(\mu\) match up with the scalar field that \(V\) and \(W\) use (so this could be \(\mathbb R\) or \(\mathbb C\) in our examples).
Much of the language used for linear maps between vector spaces is analogous to the language used for homomorphisms between groups.

Note that a linear map is completely determined by its action on a basis \(\{ \vb e_1, \cdots, \vb e_n \}\) where \(n = \dim V\), since
\[
	T\left(\sum_i x_i \vb e_i \right) = \sum_i x_i T(\vb e_i)
\]
We denote \(\vb x' = T(\vb x) \in W\), and define \(\vb x'\) as the image of \(x\) under \(T\).
Further, we define
\[
	\Im (T) = \{ \vb x' \in W : \vb x' =T(\vb x) \text{ for some } \vb x \in V \}
\]
to be the image of \(T\), and we define
\[
	\ker (T) = \{ \vb x \in V : T(\vb x) = \vb 0 \}
\]
to be the kernel of \(T\).

\begin{lemma}
	\(\ker T\) is a subspace of \(V\), and \(\Im T\) is a subspace of \(W\).
\end{lemma}
\begin{proof}
	To verify that some subset is a subspace, it suffices to check that it is non-empty, and that it is closed under linear combinations.

	\(\ker T\) is non-empty because \(\vb 0 \in \ker T\).
	For \(\vb x, \vb y \in \ker T\), we have \(T(\lambda \vb x + \mu \vb y) = \lambda T(\vb x) + \mu T(\vb y) = \vb 0 \in \ker T\) as required.

	\(\Im T\) is non-empty because \(\vb 0 \in \Im T\).
	For \(\vb x, \vb y \in V\), let \(\vb x' = T(\vb x)\) and \(\vb y' = T(\vb y)\), therefore \(\vb x', \vb y' \in \Im T\).
	Now, \(\lambda \vb x' + \mu \vb y' = T(\lambda \vb x + \mu \vb y)\) so it is closed under linear combinations as required.
\end{proof}
Here are some examples of images and kernels.
\begin{enumerate}
	\item The zero linear map \(\vb x \mapsto \vb 0\) has:
	      \begin{align*}
		      \Im T  & = \{ \vb 0 \} \\
		      \ker T & = V
	      \end{align*}
	\item The identity linear map \(\vb x \mapsto \vb x\) has:
	      \begin{align*}
		      \Im T  & = V           \\
		      \ker T & = \{ \vb 0 \}
	      \end{align*}
	\item Let \(T: \mathbb R^3 \to \mathbb R^3\), such that
	      \begin{align*}
		      x_1' & = 3x_1 - x_2 + 5x_3 \\
		      x_2' & = -x_1 - 2x_3       \\
		      x_3' & = 2x_1 + x_2 + 3x+3
	      \end{align*}
	      This map has
	      \begin{align*}
		      \Im T  & = \left\{ \lambda \begin{pmatrix} 3 \\ -1 \\ 2 \end{pmatrix} + \mu \begin{pmatrix} 1 \\ 0 \\ 1 \end{pmatrix} : \lambda, \mu \in \mathbb R \right\} \\
		      \ker T & = \left\{ \lambda \begin{pmatrix} 2 \\ -1 \\ -1 \end{pmatrix} : \lambda \in \mathbb R \right\}
	      \end{align*}
\end{enumerate}

\subsection{Rank and nullity}
We define the rank of a linear map to be the dimension of its image, and the nullity of a linear map to be the dimension of its kernel.
\[
	\rank T = \dim \Im T; \quad \nullity T = \dim \ker T
\]
Note that therefore for \(T: V \to W\), we have \(\rank T \leq \dim W\) and \(\ker T \leq \dim V\).
\begin{theorem}
	For some linear map \(T: V \to W\),
	\[
		\rank T + \nullity T = \dim V
	\]
\end{theorem}
\begin{proof}
	This proof is non-examinable (without prompts).
	Let \(\vb e_1, \cdots, \vb e_k\) be a basis for \(\ker T\), so \(T(\vb e_i) = \vb 0\) for all valid \(i\).
	We may extend this basis by adding more vectors \(\vb e_i\) where \(k < i \leq n\) until we have a basis for \(V\), where \(n=\dim V\).
	We claim that the set \(\mathcal B = \{ T(\vb e_{k+1}), \cdots, T(\vb e_n) \}\) is a basis for \(\Im T\).
	If this is true, then clearly the result follows because \(k = \dim \ker T = \nullity T\) and \(n-k = \dim \Im T = \rank T\).

	To prove the claim we need to show that \(\mathcal B\) spans \(\Im T\) and that it is a linearly independent set.
	\begin{itemize}
		\item \(\mathcal B\) spans \(\Im T\) because for any \(\vb x = \sum_{i=1}^n x_i \vb e_i\), we have
		      \[
			      T(\vb x) = \sum_{i=k+1}^n x_i T(\vb e_i) \in \vecspan \mathcal B
		      \]
		\item \(\mathcal B\) is linearly independent.
		      Consider a general linear combination of basis vectors:
		      \[
			      \sum_{i=k+1}^n \lambda_i T(\vb e_i) = 0 \implies T\left( \sum_{i=k+1}^n \lambda_i \vb e_i \right) = 0
		      \]
		      so
		      \[
			      \sum_{i=k+1}^n \lambda_i \vb e_i \in \ker T
		      \]
		      Because this is in the kernel, it may be written in terms of the basis vectors of the kernel.
		      So, we have
		      \[
			      \sum_{i=k+1}^n \lambda_i \vb e_i = \sum_{i=1}^k \mu_i \vb e_i
		      \]
		      This is a linear relation in terms of all basis vectors of \(V\).
		      So all coefficients are zero.
	\end{itemize}
\end{proof}

\subsection{Rotations}
Linear maps are often used to describe geometrical transformations, such as rotations, reflections, projections, dilations and shears.
A convenient way to express these maps is by describing where the basis vectors are mapped to.
In \(\mathbb R^2\), we may describe a rotation anticlockwise around the origin by angle \(\theta\) with
\begin{align*}
	\vb e_1 & \mapsto \cos \theta \vb e_1 + \sin \theta \vb e_2  \\
	\vb e_2 & \mapsto -\sin \theta \vb e_1 + \cos \theta \vb e_2
\end{align*}
In \(\mathbb R^3\) we can construct a similar transformation for a rotation around the \(\vb e_3\) axis with
\begin{align*}
	\vb e_1 & \mapsto \cos \theta \vb e_1 + \sin \theta \vb e_2  \\
	\vb e_2 & \mapsto -\sin \theta \vb e_1 + \cos \theta \vb e_2 \\
	\vb e_3 & \mapsto \vb e_3
\end{align*}
We can extend this to a general rotation in \(\mathbb R^3\) about an axis given by a unit normal vector \(\hat {\vb n}\).
For any vector \(\vb x \in \mathbb R^3\) we can resolve parallel and perpendicular to \(\nhat\) as follows.
\[
	\vb x = \vb x_\parallel + \vb x_\perp;\quad \vb x_\parallel = (\vb x \cdot \nhat) \nhat;\quad \vb x_\perp = \vb x - (\vb x \cdot \nhat) \nhat
\]
Note that \(\nhat\) resembles the \(\vb e_3\) axis here, and \(\vb x_\perp\) resembles the \(\vb e_1\) axis.
So we can compute the equivalent of \(\vb e_2\) using the cross product, \(\nhat \times \vb x_\perp = \nhat \times \vb x\).
Now we may define the map with
\begin{align*}
	\vb x_\parallel & \mapsto \vb x_\parallel                                               \\
	\vb x_\perp     & \mapsto (\cos \theta) \vb x_\perp + (\sin \theta)(\nhat \times \vb x)
\end{align*}
So all together, we have
\[
	\vb x \mapsto (\cos \theta) \vb x + (1 - \cos \theta) (\nhat \cdot \vb x)\nhat + (\sin \theta)(\nhat \times \vb x)
\]

\subsection{Reflections and projections}
For a plane with normal \(\nhat\), we define a projection to be
\begin{align*}
	\vb x_\parallel & \mapsto \vb 0                                           \\
	\vb x_\perp     & \mapsto \vb x_\perp                                     \\
	\vb x           & \mapsto \vb x_\perp = \vb x - (\vb x \cdot \nhat) \nhat
\end{align*}
and a reflection to be
\begin{align*}
	\vb x_\parallel & \mapsto -\vb x_\parallel                                                   \\
	\vb x_\perp     & \mapsto \vb x_\perp                                                        \\
	\vb x           & \mapsto \vb x_\perp - \vb x_\parallel = \vb x - 2(\vb x \cdot \nhat) \nhat
\end{align*}
The same expressions also apply in \(\mathbb R^2\), where we replace the plane with a line.

\subsection{Dilations}
Given scale factors \(\alpha, \beta, \gamma > 0\), we define a dilation along the axes by
\begin{align*}
	\vb e_1 & \mapsto \alpha \vb e_1 \\
	\vb e_2 & \mapsto \beta \vb e_2  \\
	\vb e_3 & \mapsto \gamma \vb e_3
\end{align*}

\subsection{Shears}
Let \(\vb a, \vb b\) be orthogonal unit vectors in \(\mathbb R^3\), i.e.\ \(\abs{\vb a} = \abs{\vb b} = \vb 0\) and \(\vb a \cdot \vb b = 0\), and we define a real parameter \(\lambda\).
A shear is defined as
\begin{align*}
	\vb x & \mapsto \vb x' = \vb x + \lambda \vb a (\vb x \cdot \vb b) \\
	\vb a & \mapsto \vb a                                              \\
	\vb b & \mapsto \vb b + \lambda \vb a
\end{align*}
This definition holds equivalently in \(\mathbb R^2\).

\subsection{Matrices}
Consider a linear map \(T: \mathbb R^n \to \mathbb R^m\), with standard bases \(\{ \vb e_i \} \in \mathbb R^n\), \(\{ \vb f_a \}, \in \mathbb R^m\), and with \(T(\vb x) = \vb x'\).
Let further

\[
	\vb x = \sum_i x_i \vb e_i = \begin{pmatrix}
		x_1 \\ x_2 \\ \vdots \\ x_n
	\end{pmatrix};\quad x' = \sum_a x_a' \vb f_a = \begin{pmatrix}
		x_1' \\ x_2' \\ \vdots \\ x_m'
	\end{pmatrix}
\]

Linearity implies that \(T\) is fixed by specifying
\[
	T(\vb e_i) = \vb e_i' = \vb C_i \in \mathbb R^m
\]
We take these \(\vb C\) as columns of an \(m \times n\) array or matrix \(M\), with rows denoted as \(\vb R_a \in \mathbb R^n\).

\[
	\begin{pmatrix}
		\uparrow   &        & \uparrow   \\
		\vb C_1    & \cdots & \vb C_n    \\
		\downarrow &        & \downarrow
	\end{pmatrix} = M = \begin{pmatrix}
		\leftarrow & \vb R_1 & \rightarrow \\
		           & \vdots  &             \\
		\leftarrow & \vb R_m & \rightarrow
	\end{pmatrix}
\]

\(M\) has entries \(M_{ai} \in \mathbb R\), where \(a\) labels rows and \(i\) labels columns, so
\[
	(\vb C_i)_a = M_{ai} = (\vb R_a)_i
\]
The action of \(T\) is then given by the matrix \(M\) multiplying the vector \(\vb x\) in the following way:
\[
	\vb x' = M \vb x
\]
defined by
\[
	x_a' = M_{ai}x_i
\]
or explicitly:
\[
	\begin{pmatrix}
		x_1' \\ x_2' \\ \vdots \\ x_m'
	\end{pmatrix}
	=
	\begin{pmatrix}
		M_{11} & M_{12} & \cdots & M_{1n} \\
		M_{21} & M_{22} & \cdots & M_{2n} \\
		\vdots & \vdots & \ddots & \vdots \\
		M_{m1} & M_{m2} & \cdots & M_{mn}
	\end{pmatrix}
	\begin{pmatrix}
		x_1 \\ x_2 \\ \vdots \\ x_n
	\end{pmatrix}
	=
	\begin{pmatrix}
		M_{11} x_1 + M_{12} x_2 + \cdots + M_{1n} x_n \\
		M_{21} x_1 + M_{22} x_2 + \cdots + M_{2n} x_n \\
		\vdots                                        \\
		M_{m1} x_1 + M_{m2} x_2 + \cdots + M_{mn} x_n
	\end{pmatrix}
\]
To check that the matrix multiplication above gives the action of \(T\), we can plug in a generic value \(\vb x\), and we get
\[
	\vb x' = T\left(\sum_i x_i \vb e_i\right) = \sum_i x_i T(\vb e_i) = \sum_i x_i \vb C_i
\]
and by taking component \(a\) of the vector, we have
\[
	x_a' = \sum_i x_i (\vb C_i)_a = \sum_i x_i M_{ai}
\]
as required.
Note also that
\[
	x_a' = M_{ai}x_i = (\vb R_a)_i x_i = \vb R_a \cdot \vb x
\]
We can now regard the properties of \(T\) as properties of \(M\) (suitably interpreted).
For example:
\begin{itemize}
	\item \(\Im(T) = \Im(M) = \vecspan \{ \vb C_1, \cdots, \vb C_n \}\).
	      In words, the image of a matrix is the span of its columns.
	\item \(\ker(T) = \ker(M) = \{ \vb x: \forall a, \vb R_a \cdot \vb x = 0 \}\).
	      In some sense, the kernel of \(M\) is the subspace perpendicular to all of its rows.
\end{itemize}

\begin{example}
\begin{enumerate}
	\item The zero map \(\mathbb R^n \to \mathbb R^m\) corresponds to the zero matrix
	      \[
		      M = 0 \text{ with } M_{ai} = 0
	      \]
	\item The identity map \(\mathbb R^n \to \mathbb R^n\) corresponds to the identity (or unit) matrix
	      \[
		      M = I \text{ with } I_{ij} = \delta_{ij}
	      \]
	\item The map \(\mathbb R^3 \to \mathbb R^3\) given by \(\vb x' = T(\vb x) = M\vb x\) with
	      \[
		      M = \begin{pmatrix}
			      3  & 1 & 5  \\
			      -1 & 0 & -2 \\
			      2  & 1 & 3
		      \end{pmatrix}
	      \]
	      gives
	      \[
		      \begin{pmatrix}
			      x_1' \\ x_2' \\ x_3'
		      \end{pmatrix}
		      =
		      \begin{pmatrix}
			      3x_1 + x_2 + 5x_3 \\
			      -x_1 - 2x_3       \\
			      2x_1 + x_2 + 3x_3
		      \end{pmatrix}
	      \]
	      In this case, we may read off the column vectors \(\vb C_a\) from the matrix.
	      Note that since they form a linearly dependent set, we have
	      \[
		      \Im(T) = \Im(M) = \vecspan \{ \vb C_1, \vb C_2, \vb C_3 \} = \vecspan \{ \vb C_1, \vb C_2 \}
	      \]
	      Here, \(\vb R_2 \times \vb R_3 = \begin{pmatrix}
		      2 & -1 & -1
	      \end{pmatrix}^\transpose = \vb u\) is actually perpendicular to all rows as they form a linearly dependent set.
	      So
	      \[
		      \ker(T) = \ker(M) = \{ \lambda \vb u \}
	      \]
	\item A rotation through \(\theta\) in \(\mathbb R^2\) is given by (building from the images of the basis vectors):
	      \[
		      \begin{pmatrix}
			      \cos \theta & -\sin \theta \\
			      \sin \theta & \cos \theta
		      \end{pmatrix}
	      \]
	\item A dilation \(\vb x' = M \vb x\) with scale factors \(\alpha, \beta, \gamma\) along axes in \(\mathbb R^3\) is given by
	      \[
		      \begin{pmatrix}
			      \alpha & 0     & 0      \\
			      0      & \beta & 0      \\
			      0      & 0     & \gamma
		      \end{pmatrix}
	      \]
	\item A reflection in a plane perpendicular to a unit vector \(\nhat\) is given by a matrix \(H\) that must have the property that
	      \begin{align*}
		      \vb x' & = H \vb x = \vb x - 2(\vb x - \nhat) \nhat \\
		      x_i'   & = x_i - 2x_j n_j n_i = H_{ij}x_j           \\
		      \intertext{And by comparing coefficients of \(x_j\), and using \(\delta\) to rewrite \(x_i\) using the \(j\) index, we have}
		      H_{ij} & = \delta_{ij} - 2n_i n_j
	      \end{align*}
	      For example, with \(\nhat = \frac{1}{\sqrt 3}\begin{pmatrix}
		      1 & 1 & 1
	      \end{pmatrix}\), then \(n_i n_j = \frac{1}{3}\) for all \(i, j\), so
	      \[
		      H = \frac{1}{3}\begin{pmatrix}
			      1  & -2 & -2 \\
			      -2 & 1  & -2 \\
			      -2 & -2 & 1
		      \end{pmatrix}
	      \]
	\item A shear is defined by a matrix \(S\) such that
	      \[
		      \vb x' = S\vb x = \vb x + \lambda(\vb b \cdot \vb x)\vb a
	      \]
	      where \(\vb a\), \(\vb b\) are unit vectors with \(\vb a \perp \vb b\), and where \(\lambda\) is a real scale factor.
	      Therefore:
	      \begin{align*}
		      x_i'              & = x_i + \lambda b_j x_j a_i = S_{ij}x_j \\
		      \therefore\ S_{ij} & = \delta_{ij} + \lambda a_i b_j
	      \end{align*}
	      For example in \(\mathbb R^2\) with \(\vb a = \begin{pmatrix}
		      1 \\ 0
	      \end{pmatrix}\) and \(\vb b = \begin{pmatrix}
		      0 \\ 1
	      \end{pmatrix}\), we have
	      \[
		      S = \begin{pmatrix}
			      1 & \lambda \\ 0 & 1
		      \end{pmatrix}
	      \]
	\item A rotation matrix \(R\) in \(\mathbb R^3\) with axis \(\nhat\) and angle \(\theta\) must satisfy
	      \begin{align*}
		      \vb x'            & = R\vb x = (\cos \theta)\vb x + (1 - \cos \theta)(\nhat \cdot \vb x)\nhat + (\sin \theta)(\nhat \times \vb x) \\
		      x_i'              & = (\cos \theta)x_i + (1 - \cos \theta)n_j x_j n_i - (\sin \theta) \varepsilon_{ijk}x_j n_k = R_{ij} x_j       \\
		      \therefore\ R_{ij} & = \delta_{ij}(\cos \theta) - (1 - \cos \theta)n_i n_j - (\sin \theta)\varepsilon_{ijk} n_k
	      \end{align*}
\end{enumerate}
\end{example}

\subsection{Matrix of a general linear map}
Consider a linear map \(T: V \to W\) between general real or complex vector spaces of dimension \(n, m\) respectively.
We will choose bases \(\{ \vb e_i \}\) for \(V\) and \(\{ \vb f_a \}\) for \(W\).
The matrix representing the linear map \(T\) with respect to these bases is an \(m \times n\) array with entries \(M_{ai} \in \mathbb R\) or \(\mathbb C\) as appropriate, defined by
\[
	T(\vb e_i) = \sum_a \vb f_a M_{ai}
\]
Then
\[
	\vb x' = T(\vb x) \iff x_a' = \sum_i M_{ai}x_i = M_{ai}x_i
\]
where
\[
	\vb x = \sum_i x_i \vb e_i;\quad \vb x' = \sum_a x_a \vb f_a
\]
Note therefore that (in real vector spaces) given choices of bases \(\{ \vb e_i \}\) and \(\{ \vb f_a \}\), \(V\) is identified with \(\mathbb R_n\) in the sense that any vector has \(n\) real components, and that \(W\) is identified with \(R_m\) analogously, and that therefore \(T\) is identified with an \(m\times n\) real matrix \(M\).
Note further that entries in column \(i\) of \(M\) are components of \(T(\vb e_i)\) with respect to basis \(\{ \vb f_a \}\).

\subsection{Linear combinations}
If \(T: V \to W\) and \(S: V \to W\), between real or complex vector spaces \(V, W\) of dimension \(n, m\) respectively, are linear, then
\[
	\alpha T + \beta S: V \to W
\]
is also a linear map, where
\[
	(\alpha T + \beta S)(\vb x) = \alpha T(\vb x) + \beta S(\vb x)
\]
for any \(\vb x \in V\).
So the set of linear maps is a vector space.
If \(M\) and \(N\) are the \(m\times N\) matrices for \(T, S\) then \(\alpha M + \beta N\) is the \(m\times n\) matrix for the linear combination above, where
\[
	(\alpha M + \beta N)_{ai} + \alpha M_{ai} + \beta N_{ai};\quad a = 1, \cdots, m;\quad i = 1, \cdots, n
\]
with respect to the same bases.

\subsection{Matrix multiplication}
If \(A\) is an \(m\times n\) matrix with entries \(A_{ai}\), and \(B\) is an \(n \times p\) matrix with entries \(B_{ir}\), then we define \(AB\) to be an \(m \times p\) matrix with entries
\[
	(AB)_{ar} = A_{ai}B_{ir};\quad a = 1, \cdots, m;\quad i = 1, \cdots, n;\quad r = 1, \cdots, p
\]
The product is not defined unless the amount of columns of \(A\) matches the number of rows of \(B\).

Matrix multiplication corresponds to composition of linear maps.
Consider linear maps:
\begin{align*}
	S: \mathbb R^p \to \mathbb R^n                  & ;\; S(\vb x) = B \vb x,\, \vb x \in \mathbb R^p \\
	T: \mathbb R^n \to \mathbb R^m                  & ;\; T(\vb x) = A \vb x,\, \vb x \in \mathbb R^n \\
	\implies T \circ S: \mathbb R^p \to \mathbb R^m & ;\; (T\circ S)(\vb x) = (AB)x
\end{align*}
since
\[
	\left[ (AB)\vb x \right]_a = (AB)_{ar}x_r
\]
and
\[
	A(B(\vb x)) = A_{ai} (B\vb x)_i = A_{ai} B_{ir} x_r = (AB)_{ar}x_r
\]
as required.
The definition of matrix multiplication ensures that these answers agree.
Of course, this proof works for complex or general vector spaces.

Whenever the products are defined, then for any scalars \(\lambda\) and \(\mu\):
\begin{itemize}
	\item \((\lambda M + \mu N)P = \lambda MP + \mu NP\)
	\item \(P(\lambda M + \mu N) = \lambda PM + \mu PN\)
	\item \((MN)P = M(NP)\)
	\item \(IM = MI = M\) where \(I_{ij} = \delta_{ij}\)
\end{itemize}
We may view matrix multiplication in the following ways.
\begin{enumerate}
	\item Regarding a vector \(\vb x \in \mathbb R^n\) as a column vector (an \(n \times 1\) matrix), then the matrix-vector and matrix-matrix multiplication rules agree.
	\item Consider the product \(AB\) where \(A\) is an \(m \times n\) matrix and \(B\) is an \(n \times p\), with columns \(\vb C_r(B) \in \mathbb R^n\) and columns \(\vb C_r(AB) \in \mathbb R^m\), where \(1 \leq r \leq p\).
	      The columns are related by \(\vb C_r(AB) = A \vb C_r(B)\).
	      Less formally, eavh column in the right matrix is acted on by the left matrix as if it were a vector, then the resultant vectors are combined into the output matrix.
	\item In terms of rows and columns,
	      \[
		      AB = \begin{pmatrix}
			                 & \vdots     &             \\
			      \leftarrow & \vb R_n(A) & \rightarrow \\
			                 & \vdots     &
		      \end{pmatrix} \begin{pmatrix}
			             & \uparrow   &        \\
			      \cdots & \vb C_r(B) & \cdots \\
			             & \downarrow &
		      \end{pmatrix}
	      \]
	      gives
	      \begin{align*}
		      (AB)_{ar} & = \left[ \vb R_a(A) \right]_i \left[ \vb C_r(B) \right]_i                                                  \\
		                & = \vb R_a(A) \cdot \vb C_r(B) \text{ for real matrices, where the \(\cdot\) is the dot product in \(R^n\)}
	      \end{align*}
\end{enumerate}

\subsection{Matrix inverses}
If \(A\) is an \(m \times n\) then \(B\), an \(n \times m\) matrix, is a left inverse of \(A\) if \(BA = I\) (the \(n \times n\) identity matrix).
\(C\) is a right inverse of \(A\) if \(AC = I\) (the \(m \times m\) identity matrix).
If \(m = n\) (\(A\) is square), then one of these implies the other; there is no distinction between left and right inverses.
We say that \(B = C = A^{-1}\), \textit{the} inverse of the matrix \(A\), such that \(AA^{-1} = A^{-1}A = I\).
Not every matrix has an inverse.
If such an inverse exists, \(A\) is called invertible, or non-singular.

Consider \(\vb x, \vb x' \in \mathbb R^n\) or \(\mathbb C^n\), and \(M\) is an \(n \times n\) matrix.
If \(M^{-1}\) exists, we can solve the equation \(\vb x' = M \vb x\) for \(\vb x\), given \(\vb x'\), because we can apply the matrix inverse on the left.
For example, where \(n=2\), we have
\[
	M = \begin{pmatrix}
		M_{11} & M_{12} \\
		M_{21} & M_{22}
	\end{pmatrix}
\]
and
\begin{align*}
	x_1' & = M_{11}x_1 + M_{12}x_2 \\
	x_2' & = M_{21}x_1 + M_{22}x_2
\end{align*}
We can solve these simultaneous equations to construct the general matrix inverse.
\begin{align*}
	M_{22} x_1' - M_{12}x_2'  & = (\det M)x_1 \\
	-M_{21} x_1' + M_{11}x_2' & = (\det M)x_2
\end{align*}
where \(\det M = M_{11} M_{22} - M_{12} M_{21}\), called the determinant of the matrix.
Where the determinant is nonzero, the matrix inverse
\[
	M^{-1} = \frac{1}{\det M}\begin{pmatrix}
		M_{22}  & -M_{12} \\
		-M_{21} & M_{11}
	\end{pmatrix}
\]
exists.
Note that
\begin{align*}
	\vb C_1     & = M \vb e_1 = \begin{pmatrix} M_{11} \\ M_{21} \end{pmatrix}                            \\
	\vb C_2     & = M \vb e_2 = \begin{pmatrix} M_{12} \\ M_{22} \end{pmatrix}                            \\
	\iff \det M & = [\vb C_1, \vb C_2] = [M\vb e_1, M\vb e_2] \text{ in } \mathbb R^2
\end{align*}
So the determinant gives the signed factor by which areas are scaled under the action of \(M\).
\(\det M\) is nonzero if and only if \(M\vb e_1\) and \(M\vb e_2\) are linearly independent, which is true if and only if the image of \(M\) has dimension 2, i.e.\ \(M\) has maximal rank.
For example, a shear
\[
	S(\lambda) = \begin{pmatrix}
		1 & \lambda \\ 0 & 1
	\end{pmatrix}
\]
has determinant 1, so areas are preserved.
In particular, in this case,
\[
	S^{-1}(\lambda) = \begin{pmatrix}
		1 & -\lambda \\ 0 & 1
	\end{pmatrix} = S(-\lambda)
\]
As another example, we know that a matrix \(R(\theta)\) for a rotation about a fixed axis \(\nhat\) through angle \(\theta\) has formula
\begin{align*}
	R(\theta)_{ij} R(-\theta)_{jk} & = (\delta_{ij}\cos \theta + (1 - \cos \theta) n_i n_j - \varepsilon_{ijp}n_p \sin \theta) \times (\delta_{jk}\cos \theta + (1 - \cos \theta) n_j n_k + \varepsilon_{jkq}n_q \sin \theta) \\
	\intertext{Expanding out, noting that \(n_i n_i = 1\) as \(\nhat\) is a unit vector, and cancelling:}
	                               & = \delta_{ik} \cos^2 \theta + 2\cos \theta(1 - \cos \theta) n_i n_k + (1 - \cos \theta)^2n_i n_k - \varepsilon_{ijp}\varepsilon_{jkq} n_p n_q \sin^2 \theta                              \\
	\intertext{By using an \(\varepsilon\varepsilon\) identity:}
	                               & = \delta_{ik}\cos^2\theta + (1 - \cos^2 \theta)n_i n_k + \delta_{ik}n_p n_p \sin^2 \theta - (\sin^2 \theta)n_i n_k                                                                       \\
	                               & = \delta_{ik}\cos^2\theta + \delta_{ik}n_p n_p \sin^2 \theta                                                                                                                             \\
	                               & = \delta_{ik}\cos^2\theta + \delta_{ik} \sin^2 \theta                                                                                                                                    \\
	                               & = \delta_{ik}
\end{align*}
as required.
